package com.zq.rabbitmq.controller;

import com.zq.rabbitmq.servcie.DirectSenderServiceImpl;
import com.zq.rabbitmq.servcie.FanoutSernderServicelmpl;
import com.zq.rabbitmq.servcie.SenderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PublicController {
    @Autowired
    private DirectSenderServiceImpl directSenderServicelmpl;
    @Autowired
    private FanoutSernderServicelmpl fanoutSernderServicelmpl;

    @RequestMapping("/directSenderString")
    public String sender(String string){
        directSenderServicelmpl.sendString(string);
        return "succ";
    }

    @RequestMapping("/fanoutSenderString")
    public String sender1(String string){
        fanoutSernderServicelmpl.sendString(string);
        return "succ";
    }
    @RequestMapping("/")
    public String sender2(){
        return "succ";
    }
}
